/**
 * There are <a href="https://github.com/thinkgem/jeesite">JeeSite</a> code generation
 */
package com.chlitina.store.modules.sms.entity;

import java.io.Serializable;

/**
 * 复合主键
 * @author liujiang
 * @version 2013-06-07
 */
public class DiagnoseStorePK implements Serializable{
	
	private static final long serialVersionUID = 1L;
	private StoreDiagnose storeDiagnose; // 范围
	private StoreDiagnoseTemplateDetail storeDiagnoseTemplateDetail; // 范围
	
	public DiagnoseStorePK() {
		
	}
	
	public DiagnoseStorePK(StoreDiagnose storeDiagnose, StoreDiagnoseTemplateDetail storeDiagnoseTemplateDetail) {
		this.storeDiagnose = storeDiagnose;
		this.storeDiagnoseTemplateDetail = storeDiagnoseTemplateDetail;
	}
	
	public StoreDiagnose getStoreDiagnose() {
		return storeDiagnose;
	}

	public void setStoreDiagnose(StoreDiagnose storeDiagnose) {
		this.storeDiagnose = storeDiagnose;
	}

	public StoreDiagnoseTemplateDetail getStoreDiagnoseTemplateDetail() {
		return storeDiagnoseTemplateDetail;
	}

	public void setStoreDiagnoseTemplateDetail(StoreDiagnoseTemplateDetail storeDiagnoseTemplateDetail) {
		this.storeDiagnoseTemplateDetail = storeDiagnoseTemplateDetail;
	}
	
	@Override
	public int hashCode() {
		return this.storeDiagnose.hashCode() + this.storeDiagnoseTemplateDetail.hashCode();
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		final DiagnoseStorePK other = (DiagnoseStorePK) obj;
		if (storeDiagnose.getId() == other.getStoreDiagnose().getId() &&
				storeDiagnoseTemplateDetail.getId() == other.getStoreDiagnoseTemplateDetail().getId()) {
			return true;
		} 
		return false;
	}
}